<?php 
class holidaylogsDao extends Dao {
	
	public $table_name = 'jh_holiday_logs';
	private $fields = "id,staff_id,holiday_type,opperate_type,days,reason,operate_user,staff_name,operate_time";
	
// 	`id` int(11) NOT NULL COMMENT '操作记录表',
// 	`staff_id` int(11) DEFAULT '0' COMMENT '操作员工id',
// 	`holiday_type` tinyint(2) DEFAULT NULL COMMENT '假期类型 0：年假 1：调休',
// 	`opperate_type` tinyint(2) DEFAULT NULL COMMENT '增减类型 0：增加 1：减少',
// 	`days` decimal(10,2) DEFAULT NULL COMMENT '操作天数',
// 	`reason` varchar(255) DEFAULT NULL COMMENT '增减原因',
// 	`operate_user` varchar(255) DEFAULT NULL COMMENT '操作人姓名',
// 	`staff_name` varchar(255) DEFAULT NULL COMMENT '被操作员工姓名',
// 	`operate_time` datetime DEFAULT NULL COMMENT '操作时间',
	
	/**
	 * 新增记录信息
	 * @param 
	 */
	public function addLogs($logs_data) {
		$input_record_data = $this->dao->db->build_key($logs_data, $this->fields);
		return $this->dao->db->insert($logs_data, $this->table_name);
	}
	/**
	 * 获取操作记录
	 * @param unknown $staff_id
	 * @param number $count
	 * @return Ambigous <multitype:, boolean>
	 */
	public function getLogsByStaff($staff_id,$count=100){
		$sql = "select ".$this->fields." from ".$this->table_name." where staff_id ='"
				.$staff_id."'"." order by operate_time desc "."limit 0,".$count;
		//print_r($sql);exit;
		$logs_data = $this->dao->db->get_all_sql($sql);
		return $logs_data;
	}
	
	

	

	
}